export default{
	path:'/movies',
	component:() => import ('@/views/movies/movies.vue'),
	children:[
		//城市路由
		{
			path:'city',
			component:()=> import('@/components/City/City.vue')
		},
		//即将上映路由
		{
			path:'commingsoon',
			component:()=> import('@/components/ComingSoon/ComingSoon.vue')
		},
		//搜索路由
		{
			path:'search',
			component:()=> import('@/components/Search/Search.vue')
		},
		//正在热播路由
		{
			path:'nowplaying',
			component:()=> import('@/components/NowPlaying/NowPlaying.vue')
		},

		//解决多个路由跳转到同一个组件下的问题 命名路由
		{
			path:'detail/1/:movieId',//路由传值
			components:{
				default:()=>import ('@/components/NowPlaying/NowPlaying.vue'),//解决空白页路由问题
				detail:()=>import ('@/views/movies/detail.vue')//详情页组件
			},
			//如果是单个路由组件传参就是 props:true 而多个就是一下情况
			props:{
				detail:true
			}
		},
		{
			path:'detail/2/:movieId',//同上。这是从即将上映组件跳转到详情页
			components:{
				default:()=>import ('@/components/ComingSoon/ComingSoon.vue'),//解决空白页路由问题
				detail:()=>import ('@/views/movies/detail.vue')//详情页组件
			},
			//如果是单个路由组件传参就是 props:true 而多个就是以下情况
			props:{
				detail:true
			}
		},
		//路由重定向
		{
			path:'/movies',
			redirect:'/movies/nowplaying'
		},
	]
}